#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<malloc.h>
typedef struct stu
{
    int* p;
    int size;
    int cap;
}sl;

text(sl* e)
{
    int new = 0;
    scanf("%d", &new); 
    sl* q = (sl*)malloc(sizeof(sl) * new); 
    e->p = q;
    e->cap = new;
}
int main()
{
    sl e;
    e.cap = 0;
    e.size = 0;
    e.p = NULL;
    text(&e);
    for (int i = 0; i < e.cap; i++)
    {
        scanf("%d", &e.p[e.size]);
        e.size++;
    }
    int i = 1, q = 0, max = 0;
    if (e.size-1 < 3)
    {
        for (int k = 0; k < e.size; k++)
        {
            if (max < e.p[k])
            {
                max = e.p[k]; q = k;
            }
        }
        printf("%d", q); exit(-1);
    }
    for (; i < e.size - 1; i++)
    {
        if (i == e.size - 1)
        {
            if (e.p[i] > e.p[i - 1])
                printf("%d", i);
            exit(-1);
        }
        if (e.p[i] > e.p[i - 1] && e.p[i] > e.p[i + 1])
            break;
    }
    printf("%d", i);
}